import { Tabs } from 'antd';
import TransactionProcessComparison from './components/TransactionProcessComparison';
// @ts-ignore
import MediumLongStrategyReview from './components/MediumLongStrategyReview';
import NewMediumlongTermResetting from './components/NewMediumlongTermResetting';
import React, { useEffect, useMemo, useState } from 'react';
import styles from './index.less';
// @ts-ignore
import { queryMarketList } from './services';
// @ts-ignore
import { HttpCode } from '#/utils/contacts';
import { connect } from 'umi';
import _ from 'lodash';
import moment from 'moment/moment';
// @ts-ignore
import { PageLoading, TRDefault } from '@/components';
// @ts-ignore
import { getTreeByCodes } from '@/utils';

const OperatingDataDisclosure = ({ menuCode }: any) => {
  const { TabPane } = Tabs;
  const [tab, setTab] = useState('1');

  const [loading, setLoading] = useState(false);

  const [power, setPower] = useState([]);

  const [error, setError] = useState('');

  const onChange = (key: string) => {
    setTab(key);
  };

  /*   useEffect(() => {
      fetchData().then();
    }, []); */

  /*   const fetchData = async () => {
      // 获取数据权限
      setLoading(true);
      let error = '';
      const res = await queryMarketList(menuCode).catch(() => setLoading(false));
      setLoading(false);
      if (res?.statusCode === HttpCode.SUCCESS) {
        const power = getTreeByCodes(['market', 'group', 'station'], res.json).treeOptions;
        setPower(power);
      } else {
        error = res?.message;
      }
      setError(error);
    }; */

  /*   if (loading) return <PageLoading />;
    if (error) return <TRDefault type={'error'} message={error} />;
    if (!power?.length) return <TRDefault type={'lock'} />; */
  return (
    <div className={styles.container}>
      {/* <Tabs defaultActiveKey={tab} onChange={onChange}> */}
      {/* <TabPane tab="交易过程对比" key="1">
          <TransactionProcessComparison power={power} />
        </TabPane> */}
      {/* <TabPane tab="决策质量评价" key="2">
          <EvaluationDecisionQuality />
        </TabPane>
        <TabPane tab="偏差归因分析" key="3">
          <BiasAttributionAnalysis />
        </TabPane> */}
      {/* <TabPane tab="合同转让收益复盘" key="4">
          <MediumLongStrategyReview power={power} />
        </TabPane> */}
      {/* </Tabs> */}
      <NewMediumlongTermResetting />
    </div>
  );
};

export default connect(({ global }: any) => ({
  menuCode: global.configure.menuCode,
  buttonPermissions: global.configure.buttonPermissions,
}))(OperatingDataDisclosure);
